/*************************************************************************
Crytek Source File.
Copyright (C), Crytek Studios, 2001-2011.
-------------------------------------------------------------------------
$Id$
$DateTime$
Description: Telemetry UDP stream.

-------------------------------------------------------------------------
History:
- 12:05:2011: Created by Paul Slinger

*************************************************************************/

#ifndef __TELEMETRYUDPSTREAM_H__
#define __TELEMETRYUDPSTREAM_H__

#ifdef WIN32
#include <winsock2.h>
#endif //WIN32

#include "ITelemetryStream.h"

namespace Telemetry
{
	class CUDPStream : public Telemetry::IStream
	{
		public:

			CUDPStream();

			~CUDPStream();

			bool Init(const string &serverIP);

			void Shutdown();

			void Release();

			void Write(const uint8 *pData, size_t size);

		private:

			bool m_initialized;

#ifdef WIN32
			void PrintLastWSAError() const;

			SOCKET			m_outputSocket;

			sockaddr_in	m_serverAddress;
#endif //WIN32
	};
}

#endif //__TELEMETRYUDPSTREAM_H__